#ifndef _ENCODER_H_
#define _ENCODER_H_

//#include "data_type.h"
#include <sys.h>	
//#include "config.h"

/*********************************/
/*   user variables              */
/*********************************/

/*********************************/
/*   user functions              */
/*********************************/




typedef struct 
{
	int32_t L_encoder_cnt;
	int32_t R_encoder_cnt;
	int32_t L_encoder_delta_cnt;
	int32_t R_encoder_delta_cnt;
	int32_t Extra_encoder_delta_cnt;
	int32_t Extra_encoder_cnt;

}EncoderTypedef;

typedef struct
{
	void (*left_encoder_init)(void);
	void (*right_encoder_init)(void);
	void (*extra_encoder_init)(void);
	
	uint16_t (*get_left_encoder_counts)(void);
	uint16_t (*get_right_encoder_counts)(void);
	uint16_t (*get_extra_encoder_counts)(void);
	void (*encoder_update)(void);
}encoder_op_t;

extern EncoderTypedef Encoder;
extern const encoder_op_t encoder_op;
int read_encoder(uint8_t tim_ch);

//void LeftEncoderInit(void);
//void RightEncoderInit(void);
//uint16_t GetLeftEncoderCount(void);
//uint16_t GetRightEncoderCount(void);




#endif
